= form_for [:admin, innoaward, product], html: { class: 'ui form' } do |f|
  .two.fields
    .required.field
      = f.label :name, '产品名称'
      = f.text_field :name
    .required.field
      = f.label :url, '产品网址'
      = f.text_field :url
  .required.field
    = f.label :logo, '产品LOGO'
    = image_tag((product.logo.url if product.logo?), id: 'logo-preview')
  .field
    = f.file_field :logo, id: 'logo-input'
    = f.hidden_field :logo_cache
  .required.field#screenshots-preview
    = f.label :screenshots, '产品截图'
    - product.screenshots.each do |ss|
      = image_tag ss.url, size: '200'
  .field
    = f.file_field(:screenshots, multiple: true, id: 'screenshots-input')
  .required.field
    = f.label :summary, '产品简介'
    = f.text_field :summary
  .required.field
    = f.label :description, '产品描述'
    = f.text_area :description
  .required.field
    = f.label :note, '备注'
    = f.text_field :note
  .two.fields
    .required.field
      = f.label :published_at, '上线时间'
      = f.date_field :published_at
    .field
      = f.label :weibo, '微博地址'
      = f.text_field :weibo
  .two.fields
    .required.field
      = f.label :category, '产品类别'
      = f.select :category, options_for_select(Product.category.values.map{|c| [t('activerecord.attributes.product.category.' + c), c]}, product.category || 'app')
    .field
      = f.label :recommended_platform, '推荐平台'
      = f.text_field :recommended_platform, value: product.recommended_platform.try(:join, ', ')
  .three.fields
    .required.field
      = f.label :c_name, '联系人姓名'
      = f.text_field :c_name
    .required.field
      = f.label :c_corp, '联系人公司'
      = f.text_field :c_corp
    .required.field
      = f.label :c_position, '联系人职位'
      = f.text_field :c_position
  .three.fields
    .required.field
      = f.label :c_corp_addr, '联系人公司地址'
      = f.text_field :c_corp_addr
    .required.field
      = f.label :c_email, '联系人邮箱'
      = f.text_field :c_email
    .required.field
      = f.label :c_mobile, '联系人电话'
      = f.text_field :c_mobile
  .field
    = f.label :evaluation, '编辑点评'
    = f.text_field :evaluation
  .field
    = submit_tag '提交', class: 'ui blue button'
